<template>
	<view class="order-pages" :style="{background:pageColor}" v-if="isLoad">
		<block v-if="serviceTypeList&&serviceTypeList.length>0">
			<view class="space-md"></view>
			<view class="ml-lg mr-lg fill-base radius-16" v-if="serviceTypeList.length>1">
				<view class="flex-between pd-lg">
					<view class="f-title c-title text-bold">服务方式</view>
					<view class="flex-center">
						<view @tap.stop="toChangeItem(index,3)" class="flex-center service-type-item c-caption"
							:class="[{'ml-lg':index!=0}]"
							:style="{background:serviceTypeInd == index ? primaryColor:'',color:serviceTypeInd == index ? '#fff':''}"
							v-for="(item,index) in serviceTypeList" :key="index">
							{{item.title}}
						</view>
					</view>
				</view>
			</view>
		</block>
		<abnor @confirm="$util.goUrl({url:`/pages/service`,openType:`reLaunch`})"
			:tip="[{ text: no_data_msg, color: 0 }]" :button="[{ text: '去看看其他服务' , type: 'confirm' }]" btnSize=""
			:isCenter="true" v-else>
		</abnor>

		<view v-if="orderInfo.order_goods && orderInfo.order_goods.length > 0">

			<block v-if="serviceTypeList[serviceTypeInd].id === 1">

				<view class="store-info ml-lg mr-lg pd-lg  fill-base radius-16"
					:class="[{'mt-md':serviceTypeList&&serviceTypeList.length>1}]"
					v-if="orderInfo.store_info && orderInfo.store_info.id">
					<view class="flex-between pb-md b-1px-b">
						<view class="f-sm-title text-bold c-title" :class="[{'max-400':orderInfo.store_num>1}]">
							{{orderInfo.store_info.title}}
						</view>
						<view
							@tap.stop="$util.goUrl({url:`/agent/pages/shopstore/choose-store?id=${orderInfo.store_info.id}&ocid=${orderInfo.coach_id}`})"
							class="flex-y-center f-mini-title text-bold" :style="{color:primaryColor}"
							v-if="orderInfo.store_num>1"><i class="iconfont iconqiehuan1 text-normal mr-sm"></i>切换门店
						</view>
					</view>
					<view class="f-caption pt-lg" style="color: #222;">
						<view class="pb-md">
							{{orderInfo.store_info.start_time}} - {{orderInfo.store_info.end_time}}
						</view>
						<view class="flex-between">
							<view>
								<span>{{orderInfo.store_info.address || `暂未设置门店地址`}}</span>
								<span @tap.stop="toCopy(orderInfo.store_info.address)"
									class="copy-btn span radius-5 f-icontext ml-sm"
									:style="{color:primaryColor,borderColor:primaryColor}"
									v-if="orderInfo.store_info.address">复制</span>
							</view>
							<view class="flex-center">
								<view class="flex-center flex-column ml-lg" v-if="orderInfo.store_info.address">
									<view @tap.stop="toMap" class="item-icon rel flex-center radius">
										<view class="item-icon radius abs" :style="{background:primaryColor}"></view>
										<i class="iconfont icondizhi_1" :style="{color:primaryColor}"></i>
									</view>
									<view class="f-ms-little">定位</view>
								</view>
								<view class="flex-center flex-column ml-lg" v-if="orderInfo.store_info.phone">
									<view @tap.stop="toConfirmTel(orderInfo.store_info.phone)"
										class="item-icon rel flex-center radius">
										<view class="item-icon radius abs" :style="{background:primaryColor}"></view>
										<i class="iconfont icondadianhua_1" :style="{color:primaryColor}"></i>
									</view>
									<view class="f-ms-little">电话</view>
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="mt-md ml-lg mr-lg pl-lg pr-lg fill-base radius-16">
					<view class="flex-between b-1px-b">
						<view class="item-text flex-y-center"><i class="iconfont icon-required c-warning"></i>姓名</view>
						<input v-model="form.user_name" type="text" class="item-input flex-1" maxlength="20"
							:placeholder="rule[0].errorMsg" />
					</view>
					<view class="flex-between">
						<view class="item-text flex-y-center"><i class="iconfont icon-required c-warning"></i>手机号</view>
						<input v-model="form.user_phone" type="text" class="item-input flex-1"
							:placeholder="rule[1].errorMsg" />
					</view>
				</view>
			</block>

			<view @tap.stop="$util.goUrl({url:`/user/pages/address/list?check=1`})"
				class="address-info flex-center ml-lg mr-lg pd-lg fill-base radius-16"
				:class="[{'mt-md':serviceTypeList&&serviceTypeList.length>1}]"
				v-if="serviceTypeList[serviceTypeInd].id === 0">
				<view class="address-icon flex-center c-base radius"
					:style="{background:`linear-gradient(to right, ${subColor}, ${primaryColor})`}"><i
						class="iconfont iconjuli"></i></view>
				<view class="flex-1 flex-between ml-md">
					<view class="max-500">
						<block v-if="orderInfo.address_info.id">
							<view class="flex-y-baseline username c-title text-bold">
								{{orderInfo.address_info.user_name}}
								<view class="f-sm-title" style="margin-left: 15rpx;" :style="{color:primaryColor}">
									{{orderInfo.address_info.mobile}}
								</view>
							</view>
							<view class="f-desc c-title ellipsis">
								{{`${orderInfo.address_info.address} ${orderInfo.address_info.address_info}`}}
							</view>
						</block>
						<block v-else>
							<view class="username c-title text-bold">请选择地址</view>
						</block>
					</view>
					<i class="iconfont icon-right"></i>
				</view>
			</view>

			<view class="mt-md ml-lg mr-lg pl-lg pr-lg fill-base radius-16">
				<view @tap.stop="toShowTime" class="flex-between pt-lg pb-lg">
					<view class="f-title c-title text-bold">服务时间</view>
					<view class="flex-y-center f-paragraph c-caption ml-sm">
						<view class="c-caption text-bold mr-sm" :style="{color:send_info.time?primaryColor:''}">
							{{send_info.time || '请选择预约时间'}}
						</view>
						<i class="iconfont icon-right"></i>
					</view>
				</view>
				<view class="flex-between pt-lg pb-lg b-1px-t" v-if="serviceTypeList[serviceTypeInd].id === 0">
					<view class="f-title c-title text-bold">出行方式</view>
					<view class="flex-center">
						<view @tap.stop="toChangeItem(index)" class="flex-y-center" :class="[{'ml-lg':index!=0}]"
							:style="{color:carTypeInd == index ? primaryColor:''}" v-for="(item,index) in carTypeList"
							v-show="item.id == 0 ? isBus == 1 : true" :key="index"><i class="iconfont icon-xuanze mr-sm"
								:class="[{'icon-radio-fill':carTypeInd == index}]"></i>{{item.title}}
						</view>
					</view>
				</view>
			</view>
			<view class="mt-md ml-lg mr-lg  fill-base radius-16">
				<view class="list-item flex-warp pd-lg" :class="[{'b-1px-t':index!=0}]"
					v-for="(item,index) in orderInfo.order_goods" :key="index">
					<!-- #ifdef H5 -->
					<view class="item-img radius-16">
						<view class="h5-image item-img radius-16" :style="{ backgroundImage : `url('${item.cover}')`}">
						</view>
					</view>
					<!-- #endif -->
					<!-- #ifndef H5 -->
					<image mode="aspectFill" class="item-img radius-16" :src="item.cover"></image>
					<!-- #endif -->
					<view class="flex-1 ml-md">
						<view class="f-title c-title text-bold ellipsis">{{item.title}}</view>
						<view class="flex-center">
							<view class="flex-1 flex-y-center f-desc c-caption">
								<view class="f-title c-warning mr-sm">¥{{item.price}}</view>/ {{item.time_long}}分钟
							</view>
							<view class="member-canbuy-level" v-if="item.member_info && item.member_info.title">
								<view class="text flex-center">{{item.member_info.title}}专享</view>
							</view>
						</view>
						<view class="flex-between">
							<view class="f-caption c-caption mt-sm mb-sm ellipsis" style="max-width: 300rpx;">
								{{$t('action.attendantName').substring(0, 2) === '服务' ? '' : '服务'}}{{$t('action.attendantName')}}：{{orderInfo.coach_info?orderInfo.coach_info.coach_name||'-':'-'}}
							</view>
							<view class="flex-warp">
								<button @tap.stop="changeNum(-1,index)" class="reduce"
									:style="{borderColor:primaryColor,color:primaryColor}"><i
										class="iconfont icon-jian-bold"></i></button>
								<button class="addreduce clear-btn">{{item.num || 0}}</button>
								<button @tap.stop="changeNum(1,index)" class="add"
									:style="{background:primaryColor,borderColor:primaryColor}"><i
										class="iconfont icon-jia-bold"></i></button>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="mt-md ml-lg mr-lg pl-lg pr-lg fill-base radius-16">
				<view @tap.stop="$util.goUrl({url:`/user/pages/coupon/use`})" class="flex-between pt-lg pb-lg">
					<view class="f-title c-title text-bold">卡券优惠</view>
					<view class="flex-y-center f-paragraph c-caption">
						<view class="c-warning mr-sm">
							{{orderInfo.coupon_id ? `-¥${orderInfo.discount}` : `${orderInfo.canUseCoupon}张可用`}}
						</view>
						<i class="iconfont icon-right"></i>
					</view>
				</view>
				<view @tap.stop="toUseDiscountCard" class="flex-between pt-lg pb-lg b-1px-t"
					v-if="orderInfo.member_status">
					<view class="f-title c-title text-bold">会员折扣</view>
					<view class="flex-y-center f-paragraph c-caption">
						<view
							:class="[{'c-warning':orderInfo.member_discount_balance*1>0 || orderInfo.member_discount_cash*1>0}]"
							v-if="orderInfo.is_remember">
							{{(orderInfo.member_discount_balance*1>0 || orderInfo.member_discount_cash*1>0)  ? `${orderInfo.member_discount_balance}折 (优惠¥${orderInfo.member_discount_cash})` : '-'}}
						</view>
						<view class="flex-y-center" v-if="!orderInfo.is_remember">
							<span class="flex-center f-icontext c-base mr-sm"
								style="min-width:30rpx;height:34rpx;padding:0 12rpx; background: #F13F26;border-radius: 8rpx;">{{orderInfo.coupon_id?'无':'待使用'}}</span>{{orderInfo.coupon_id?'会员优惠与卡券不可同时使用':'点击使用会员优惠'}}
						</view>
					</view>
				</view>
				<block v-if="serviceTypeList[serviceTypeInd].id === 0 && carTypeList[carTypeInd].id === 1">
					<view class="flex-between pt-lg pb-lg b-1px-t">
						<view class="f-title c-title text-bold">往返车费</view>
						<view class="flex-warp f-paragraph c-caption c-warning">
							¥{{orderInfo.free_fare?0:orderInfo.car_price}}
							<!-- <view class="c-caption text-delete ml-md" v-if="orderInfo.free_fare">
								¥{{orderInfo.car_price}}</view> -->
						</view>
					</view>
					<view class="pb-lg f-caption c-caption">
						全程共{{orderInfo.distance}}，出租出行收取来回车费，{{orderInfo.car_config.day_type==1?'日间':'夜间'}}{{orderInfo.car_config.day_type==1?orderInfo.car_config.start_distance:orderInfo.car_config.start_distance_night}}公里内，起步{{orderInfo.car_config.day_type==1?orderInfo.car_config.start_price:orderInfo.car_config.start_price_night}}元{{orderInfo.free_fare?`，${$t('action.attendantName')}免出行费`:``}}。
						<span @tap.stop="$refs.show_car_fee_rules.open()" class="text-underline"
							:style="{color:primaryColor}">查看计费规则</span>
					</view>
				</block>
			</view>

			<view class="mt-md ml-lg mr-lg pd-lg fill-base radius-16">
				<view class="flex-between">
					<view class="f-title c-title text-bold">订单备注</view>
					<view @tap.stop="$refs.order_text_item.open()" class="flex-y-center">
						<view class="flex-1 max-400 ellipsis f-paragraph text-right"
							:style="{color:!form.text?'#CECECE':'#333'}">
							{{form.text || '可添加图片和文字'}}
						</view>
						<i class="iconfont icon-right" style="font-size: 28rpx;color:#C7C7CD"></i>
					</view>
				</view>
			</view>


			<view class="mt-md ml-lg mr-lg fill-base radius-16">
				<view @tap.stop="toChangeItem(index,2)" class="flex-warp pt-lg pb-lg ml-lg mr-lg f-title c-title"
					:class="[{'b-1px-t':index!=0}]" v-for="(item,index) in payList" :key="index">
					<i class="iconfont mr-md" :class="item.icon" style="font-size: 50rpx;"></i>
					<view class="flex-1">
						<view class="flex-between">
							<view class="flex-y-center">
								<view>{{item.title}}</view>
								<view class="f-paragraph c-caption ml-md" v-if="item.id == 2">
									余额{{orderInfo.user_cash || 0}}元
								</view>
								<view class="flex-center f-icontext ml-md"
									style="padding:5rpx 10rpx;color:#FF2D00;background:#FDF5F0;border-radius: 2rpx;"
									v-if="item.id == 4 && orderInfo.balance_discount_data && (orderInfo.balance_discount_data.is_balancediscount==0 || orderInfo.balance_discount_data.user_status==0)">
									当前无可用卡/卡余额不足</view>
							</view>
							<view @tap.stop="$util.goUrl({url:`/user/pages/stored/card-use`})"
								class="flex-y-center f-desc" style="#6A6A6A"
								v-if="item.id==4&&orderInfo.balance_discount_data&&orderInfo.balance_discount_data.is_balancediscount">
								重选<i class="iconfont icon-right text-bold"
									style="font-size: 20rpx;margin-left: 5rpx;"></i>
							</view>
							<i class="pay-icon iconfont icon-xuanze mr-sm"
								:class="[{'icon-radio-fill': payInd == index}]"
								:style="{color:payInd == index ? primaryColor:'#999'}" v-else></i>
						</view>
						<view class="mt-sm f-desc" :style="{color:primaryColor}"
							v-if="item.id==4 && orderInfo.balance_discount_data">
							<view @tap.stop="$util.goUrl({url:`/user/pages/stored/list`})" class="flex-between"
								v-if="orderInfo.balance_discount_data.status && (orderInfo.balance_discount_data.is_balancediscount==0 || orderInfo.balance_discount_data.user_status==0)">
								<view>最高可享受{{ orderInfo.balance_discount_data.min_discount}}折优惠</view>
								<view class="flex-y-center">+添加新卡<i class="iconfont icon-right text-bold"
										style="font-size: 22rpx;"></i></view>
							</view>
							<block v-if="orderInfo.balance_discount_data.balance_discount_list">
								<view v-for="(aitem,aindex) in orderInfo.balance_discount_data.balance_discount_list"
									:key="aindex">
									{{aitem.title}} (消费{{aitem.value_cash}}元)
								</view>
							</block>
						</view>
					</view>
				</view>
			</view>

			<view @tap.stop="isAgree=!isAgree" class="mt-md ml-lg mr-lg pd-lg fill-base f-paragraph c-title radius-16"
				v-if="orderRules.order_rules_status == 2">
				<view class="flex-y-center" style="height: 40rpx;">
					<i class="iconfont mr-sm" :class="isAgree?'icon-xuanze-fill':'icon-xuanze'"
						:style="{color:isAgree?primaryColor:''}" style="font-size: 32rpx;"></i>
					我已阅读并同意平台<view @tap.stop="$refs.order_rules_item.open()" :style="{color:primaryColor}">《下单须知》</view>
				</view>
			</view>

			<view class="space-max-footer"></view>

			<view class="pay-info fix flex-between text-right pl-lg pr-lg fill-base">
				<view class="flex-y-center f-paragraph c-title text-bold ml-sm mr-lg">合计：
					<view class="flex-y-baseline f-title c-warning">¥{{orderInfo.pay_price}}</view>
				</view>
				<auth :needAuth="!userInfo || (userInfo && (!userInfo.phone || !userInfo.nickName))"
					:type="!userInfo.phone ? 'phone' : 'userInfo'" @go="toPay(1)" style="width: 182rpx;">
					<view class="pay-btn flex-center f-paragraph c-base radius" :style="{background:primaryColor}">
						立即支付</view>
				</auth>
			</view>
		</view>

		<uni-popup ref="order_rules_item" type="center">
			<view @touchmove.stop.prevent class="popup-rule" v-if="orderRules && orderRules.order_rules_status">
				<view class="fill-base pd-lg radius-26">
					<view class="f-sm-title c-title text-bold flex-center pt-md pb-lg">下单须知</view>
					<scroll-view scroll-y style="width: 100%;min-height:15vh;max-height:50vh">
						<parser :html="orderRules.order_rules" @linkpress="linkpress" show-with-animation lazy-load>
							加载中...
						</parser>
					</scroll-view>
					<view class="button" v-if="orderRules.order_rules_status==1">
						<view @tap.stop="$refs.order_rules_item.close()" class="item-child">取消</view>
						<view @tap.stop="toConfirmOrder" class="item-child"
							:style="{background: primaryColor,color:'#fff'}">我已知晓</view>
					</view>
				</view>
				<view @tap="$refs.order_rules_item.close()" class="flex-center pd-lg"
					v-if="orderRules.order_rules_status==2"><i class="iconfont icon-close c-base"></i></view>
			</view>
		</uni-popup>


		<uni-popup ref="show_car_fee_rules" type="center">
			<view class="popup-rule" v-if="orderInfo && orderInfo.car_config">
				<view class="fill-base pd-lg radius-26">
					<view class="f-sm-title c-title text-bold flex-center pt-md pb-lg">车费计算规则</view>
					<scroll-view scroll-y @touchmove.stop.prevent class="rule-text">
						<span
							class="c-title text-bold">日间车费</span>（{{orderInfo.car_config.car_price_start}}-{{orderInfo.car_config.car_price_end}}）：{{orderInfo.car_config.start_distance}}公里内，起步{{orderInfo.car_config.start_price}}元。
						<span v-if="orderInfo.car_config.cash_type === 1">
							里程计价{{orderInfo.car_config.distance_price}}元/公里。
						</span>
						<span v-if="orderInfo.car_config.cash_type === 2">
							<span v-for="(item,index) in orderInfo.car_config.cash_setting_day" :key="index">
								{{index==0?orderInfo.car_config.start_distance:orderInfo.car_config.cash_setting_day[index-1].km}}-{{item.km}}公里，里程计价{{item.cash}}元/公里。
							</span>
						</span>
						<div class="mt-md"
							v-if="orderInfo.car_config.car_price_start!='00:00' || orderInfo.car_config.car_price_end!='24:00'">
							<span
								class="c-title text-bold">夜间车费</span>（{{orderInfo.car_config | handlePriceTime}}）：{{orderInfo.car_config.start_distance_night}}公里内，起步{{orderInfo.car_config.start_price_night}}元。
							<span v-if="orderInfo.car_config.cash_type_night === 1">
								里程计价{{orderInfo.car_config.distance_price_night}}元/公里。
							</span>
							<span v-if="orderInfo.car_config.cash_type_night === 2">
								<span v-for="(item,index) in orderInfo.car_config.cash_setting_night" :key="index">
									{{index==0?orderInfo.car_config.start_distance_night:orderInfo.car_config.cash_setting_night[index-1].km}}-{{item.km}}公里，里程计价{{item.cash}}元/公里。
								</span>
							</span>
						</div>
					</scroll-view>
				</view>
				<view @tap="$refs.show_car_fee_rules.close()" class="flex-center pd-lg"><i
						class="iconfont icon-close c-base"></i></view>
			</view>
		</uni-popup>

		<uni-popup ref="show_time_item" type="bottom">
			<view class="popup-time fill-base">
				<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex*1" :activeColor="primaryColor"
					height="100rpx"></tab>
				<scroll-view scroll-y @touchmove.stop.prevent class="time-list">
					<view class="flex-warp">
						<view @tap.stop="toChooseTime(index)" class="time-item flex-center flex-column"
							:class="[{'can-choose':item.status && send_info.time_str != item.time_str},{'cur-check':send_info.time_str == item.time_str}]"
							:style="{background:send_info.time_str == item.time_str ?primaryColor:''}"
							v-for="(item,index) in timeList" :key="index">
							<view class="f-title">{{item.time_text}}</view>
							<view class="f-caption">{{item.status?'可预约':'不可预约'}}</view>
						</view>
						<view class="ml-md c-caption" v-if="timeList.length==0">暂无时间段</view>
					</view>
				</scroll-view>
				<view class="space-safe"></view>
			</view>
		</uni-popup>

		<uni-popup ref="order_text_item" type="bottom" radius="0rpx">
			<view class="popup-order-text pd-lg f-paragraph c-desc fill-base">
				<i @tap.stop="$refs.order_text_item.close()" class="iconfont icon-close abs"></i>
				<view class="flex-center f-sm-title text-bold" style="color:#19293F;margin: 10rpx 0 50rpx 0;">
					订单备注
				</view>
				<view class="order-text c-caption mt-sm pd-lg radius-16">
					<textarea v-model="form.text" class="textarea f-paragraph c-title" maxlength="100"
						placeholder-class="f-paragraph" placeholder-style="color:#A6AEBB"
						placeholder="请输入订单备注内容"></textarea>
					<view class="flex-between pb-sm">
						<view></view>
						<view>{{form.text.length>100?100:form.text.length}}/100</view>
					</view>
				</view>
				<view class="flex-between pt-lg">
					<upload @upload="imgUpload" @del="imgUpload" :imagelist="form.text_img" filetype="picture"
						imgtype="text_img" text="上传图片" :imgsize="5">
					</upload>
				</view>
				<view style="height:40rpx"></view>
				<view @tap.stop="$refs.order_text_item.close()" class="item-btn flex-center f-sm-title c-base radius-16"
					:style="{background:primaryColor}">确定</view>
				<view class="space-safe"></view>
			</view>
		</uni-popup>


		<uni-popup ref="order_tips_item" type="center" :custom="true">
			<view @touchmove.stop.prevent class="common-popup-content fill-base radius-34"
				v-if="send_info&&send_info.time&&orderInfo&&orderInfo.time_long&&orderInfo.place_order_pop">
				<view class="flex-center f-title c-title text-bold pb-lg">温馨提示</view>
				<view style="word-break: break-all">
					该订单为<span style="padding:0 10rpx" :style="{color:primaryColor}">预约单</span>，您预约的时间为<span
						:style="{color:primaryColor}">{{send_info | handleOrderTime(orderInfo.time_long)}}</span>
					，请确认您的预约时间
				</view>
				<view class="button">
					<view @tap.stop="toConfirmPay(1)" class="item-child md">
						重选时间/{{$t('action.attendantName')}}
					</view>
					<view @tap.stop="toConfirmPay(2)" class="item-child md"
						:style="{background: primaryColor,color:'#fff'}">
						确认时间并支付
					</view>
				</view>
				<view class="space-safe"></view>
				</block>
			</view>
		</uni-popup>


		<!-- #ifdef MP-WEIXIN -->
		<user-privacy ref="user_privacy" :show="false"></user-privacy>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS -->
		<longbingbing-app-check-auth type="phone" ref="app_check_item"
			@confirm="$util.goUrl({ url:call_phone, openType: 'call' })"></longbingbing-app-check-auth>
		<!-- #endif -->
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from "vuex"
	import $util from "@/utils/index.js"
	import parser from "@/components/jyf-Parser/index"
	export default {
		components: {
			parser
		},
		data() {
			return {
				options: {},
				call_phone: '',
				isLoad: false,
				isNoPay: true,
				no_pay_order: [],
				orderRules: {},
				no_data_msg: '',
				serviceTypeList: [],
				serviceTypeInd: 0,
				carTypeList: [{
					id: 1,
					title: '出租车'
				}, {
					id: 0,
					title: '公交/地铁'
				}],
				carTypeInd: 0,
				// 1微信支付；2余额支付；3支付宝支付; 4储值折扣卡
				payList: [{
					id: 2,
					icon: 'iconqianbao c-balance',
					title: '账户余额'
				}],
				payInd: 0,
				tabList: [],
				activeIndex: 0,
				timeList: [],
				send_info: {},
				orderInfo: {
					coupon_id: 0,
					address_info: {
						id: 0
					},
					member_status: 0,
					is_remember: 0,
					balance_discount_data: {
						is_balancediscount: 0,
						balance_discount_list: []
					}
				},
				form: {
					user_name: '',
					user_phone: '',
					text: '',
					text_img: []
				},
				rule: [{
						name: "user_name",
						checkType: "isNotNull",
						errorMsg: "请输入您的姓名",
						regType: 2
					},
					{
						name: "user_phone",
						checkType: "isMobile",
						errorMsg: "请输入手机号"
					}
				],
				isAgree: false,
				lockTap: false,
				isBus: 0,
			}
		},
		computed: mapState({
			configInfo: state => state.config.configInfo,
		}),
		watch: {
			'send_info.time'(value) {
				let {
					time_str: start_time
				} = this.send_info
				this.getIsBusCall(start_time)
				this.initRefresh()
			},
			'orderInfo.order_goods'(value) {
				let arr = value && value.length > 0 ? value.map(item => {
					let {
						id: goods_id,
						title: goods_name,
						cover: goods_cover,
						price: goods_price
					} = item
					return {
						goods_id,
						goods_name,
						goods_cover,
						goods_price
					}
				}) : []
				this.no_pay_order = arr
			}
		},
		async onLoad(options) {
			this.options = options
			this.$util.showLoading()
			let {
				store = false
			} = this.configInfo.plugAuth
			this.no_data_msg = store ? `该${this.$t('action.attendantName')}不支持到店服务或服务已下架~` : `服务已下架~`
			await this.initIndex()
			let {
				time = 0
			} = this.send_info
			if (!time) {
				this.getIsBusCall('')
			}
			// #ifdef H5
			this.$jweixin.hideOptionMenu()
			// #endif 
		},
		onShow() {
			// #ifdef APP-PLUS
			var args = plus.runtime.arguments
			if (['wechat-adapay-suc', 'wechat-adapay-fail'].includes(args)) {
				let tab = args == 'wechat-adapay-suc' ? 2 : 1
				this.$util.goUrl({
					url: `/pages/order?tab=${tab}`,
					openType: `reLaunch`
				})
			}
			plus.runtime.arguments = null
			plus.runtime.arguments = ""
			// #endif
		},
		// #ifdef H5
		destroyed() {
			// #endif
			// #ifndef H5
			onUnload() {
					// #endif
					let {
						isNoPay,
						no_pay_order
					} = this
					let {
						orderradar = false
					} = this.configInfo.plugAuth
					if (orderradar && isNoPay && no_pay_order.length > 0) {
						let {
							id: coach_id = 0
						} = this.options
						let val = {
							coach_id,
							order_goods: no_pay_order
						}
						this.$api.order.noPayRecordAdd(val)
						this.updateOrderItem({
							key: 'noPayRecord',
							val
						})
					}
				},
				methods: {
					...mapActions(['getConfigInfo']),
					...mapMutations(['updateUserItem', 'updateOrderItem']),
					async initIndex(refresh = false) {
						let {
							id: coach_id,
							ser_id: service_id = 0,
							store_id = 0
						} = this.options
						store_id = store_id * 1
						let {
							coupon_id,
							address_info,
							member_status = 0,
							is_remember = 0,
							balance_discount_data = {}
						} = this.orderInfo
						let {
							id: address_id
						} = address_info

						let {
							is_door,
							is_store
						} = await this.$api.order.getServiceType({
							coach_id
						})

						let serviceTypeList = []

						if (is_door) {
							serviceTypeList.push({
								id: 0,
								title: '上门服务'
							})
						}
						if (is_store) {
							serviceTypeList.push({
								id: 1,
								title: '到店服务'
							})
						}
						console.log(serviceTypeList, '========> serviceTypeList')
						this.serviceTypeList = serviceTypeList

						this.$util.setNavigationBarColor({
							bg: this.primaryColor
						})

						if (serviceTypeList.length == 0) {
							this.$util.hideAll()
							this.isLoad = true
							this.orderInfo.order_goods = []
							return
						}

						if (!refresh && store_id) {
							this.serviceTypeInd = this.serviceTypeList.findIndex(aitem => {
								return aitem.id == 1
							})
						}

						let car_type = this.carTypeList[this.carTypeInd].id
						let {
							id: is_door_store = 0
						} = this.serviceTypeList[this.serviceTypeInd]

						let {
							time_str: start_time = ''
						} = this.send_info


						let param = {
							is_store: is_door_store,
							service_id,
							coach_id,
							car_type,
							address_id,
							start_time
						}
						if (!refresh && store_id) {
							param.store_id = store_id
						}
						if (refresh) {
							if (is_door_store) {
								let {
									store_info = {
										id: 0
									}
								} = this.orderInfo
								let {
									id: sid = 0
								} = store_info
								param.store_id = sid || store_id
							}
							param.coupon_id = coupon_id
							if (member_status) {
								param.is_remember = is_remember || 0
							}
							let {
								id: pay_model
							} = this.payList[this.payInd]
							param.pay_model = pay_model
							let {
								is_balancediscount,
								balance_discount_list = []
							} = balance_discount_data
							if (pay_model == 4 && is_balancediscount) {
								param.balance_discount_card_arr = this.$util.getItems(balance_discount_list)
							}
						}

						if (is_door_store && !param.store_id) {
							await this.$util.getUtilLocation(false)
							let {
								lat,
								lng
							} = this.location
							param = Object.assign({}, param, {
								lat,
								lng
							})
						}

						let [data, rules = {}] = await Promise.all(!refresh ? [this.$api.order.payOrderInfo(param),
							this.$api.base
							.payOrderInfoConfig()
						] : [this.$api.order.payOrderInfo(param)])
						this.$util.hideAll()
						data.address_info = data.address_info.id ? data.address_info : {}
						data.is_remember = data.is_remember * 1 || 0
						this.orderInfo = data
						if (!refresh) {
							this.orderRules = rules
						}

						let {
							alipay_status = 0,
								near_time = {
									str: '',
									text: ''
								},
								balance_discount_data: order_discount_info = {
									auth: false,
									status: 0,
									user_status: 0
								},
								recharge_status = 0,
								balance_discount_status = 0
						} = data


						let {
							app_wechat_pay = 0
						} = this.configInfo
						let weixinInd = this.payList.findIndex(item => {
							return item.id == 1
						})
						if (app_wechat_pay && weixinInd == -1) {
							this.payList.unshift({
								id: 1,
								icon: 'iconweixinzhifu1 c-wechat',
								title: '微信支付'
							})
						}

						// #ifndef MP-WEIXIN 
						let alipayInd = this.payList.findIndex(item => {
							return item.id == 3
						})
						if (alipay_status && alipayInd == -1) {
							this.payList.splice(this.payList.length - 1, 0, {
								id: 3,
								icon: 'icon-alipay c-alipay',
								title: '支付宝支付'
							})
						}
						// #endif

						if (!recharge_status) {
							let rechargeInd = this.payList.findIndex(item => {
								return item.id == 2
							})
							if (rechargeInd != -1) {
								this.payList.splice(rechargeInd, 1)
							}
						}

						let {
							auth: balancediscount = false,
							status: discount_status = 0,
							user_status = 0,
							is_balancediscount = 0
						} = order_discount_info

						balancediscount = balancediscount && balance_discount_status
						if (balancediscount) {
							let cardInd = this.payList.findIndex(item => {
								return item.id == 4
							})
							if (cardInd == -1 && (discount_status || user_status)) {
								this.payList.unshift({
									id: 4,
									icon: 'iconcard c-discountcard',
									title: `折扣卡支付`
								})
							}
						}

						if (!refresh) {
							let pay_id = balancediscount && is_balancediscount ? 4 : 1
							this.payInd = this.payList.findIndex(item => {
								return item.id == pay_id
							})
						}

						let {
							text: time = '',
							str: time_str = ''
						} = near_time

						let {
							time: send_info_time = 0
						} = this.send_info
						if (!send_info_time && time && time_str) {
							this.send_info = {
								time,
								time_str
							}
						}
						this.isLoad = true
					},
					async initRefresh() {
						await this.initIndex(true)
					},
					linkpress(res) {
						// #ifdef APP-PLUS
						this.$util.goUrl({
							url: res.href,
							openType: 'web'
						})
						// #endif
					},
					async getIsBusCall(start_time) {
						let {
							serviceTypeList,
							serviceTypeInd
						} = this
						if (serviceTypeList.length == 0) return
						let {
							id: is_store = 0
						} = serviceTypeList[serviceTypeInd]
						let isBus = is_store ? 1 : await this.$api.order.getIsBus({
							start_time
						})
						this.isBus = isBus
						if (isBus == 0) {
							this.carTypeInd = 0
							await this.initRefresh()
						}
					},
					imgUpload(e) {
						let {
							imagelist,
							imgtype
						} = e;
						this.form[imgtype] = imagelist;
					},
					// 选择出行方式/支付方式/服务方式
					async toChangeItem(index, key = 1) {
						let {
							address_info
						} = this.orderInfo
						switch (key) {
							case 1:
								if (index == 1 && (!address_info.id || !this.send_info.time)) {
									this.$util.showToast({
										title: !address_info.id ? `请选择地址` : `请选择预约时间`
									})
									return
								}
								this.carTypeInd = index
								await this.toCheckBalanceDiscount()
								break
							case 2:
								let {
									id
								} = this.payList[index]
								let {
									user_cash = 0,
										pay_price,
										balance_discount_data = {
											user_status: 0
										}
								} = this.orderInfo
								let {
									status = 0,
										user_status = 0,
										is_balancediscount = 0
								} = balance_discount_data
								if (id == 2 && user_cash * 1 < pay_price * 1) {
									this.$util.showToast({
										title: `账户余额不足`
									})
									return
								}
								if (id == 4 && !user_status && status) {
									this.$util.showToast({
										title: `当前无可用卡/卡余额不足`
									})
									return
								}
								this.payInd = index
								if (id == 4 || (id !== 4 && is_balancediscount)) {
									this.orderInfo.coupon_id = 0
									this.orderInfo.is_remember = 0
									this.initRefresh()
								}
								break
							case 3:
								this.serviceTypeInd = index
								this.carTypeInd = index == 1 ? 1 : 0
								await this.toCheckBalanceDiscount()
								break
						}
					},
					async toCheckBalanceDiscount() {
						let {
							balance_discount_data = {}
						} = this.orderInfo
						let {
							is_balancediscount: old_discount = 0,
						} = balance_discount_data
						await this.initRefresh()
						let {
							balance_discount_data: new_data = {}
						} = this.orderInfo
						let {
							is_balancediscount = 0,
						} = new_data
						if (old_discount && !is_balancediscount) {
							await this.initRefresh()
						}
					},
					toUseDiscountCard() {
						this.orderInfo.coupon_id = 0
						this.orderInfo.is_remember = 1
						let {
							id
						} = this.payList[this.payInd]
						if (id == 4) {
							this.payInd = this.payList.findIndex(item => {
								return item.id == 1
							})
						}
						this.initRefresh()
					},
					// 加/减数量
					async changeNum(mol, index) {
						let {
							id,
							service_id,
							member_info
						} = this.orderInfo.order_goods[index]
						let {
							can_buy,
							title
						} = member_info
						if (!can_buy && mol > 0) {
							let msg = title ? title.includes('会员') ? title : `${title}会员` : '会员'
							this.$util.showToast({
								title: `您还不是${msg}`
							})
							return
						}
						let num = 0
						this.orderInfo.order_goods.map(item => {
							num += item.num
						})
						if (num === 1 && mol < 0) {
							this.$util.showToast({
								title: `至少保留一个服务哦`
							})
							return
						}
						let {
							id: coach_id
						} = this.options
						if (this.lockTap) return;
						this.lockTap = true;
						let methodModel = mol > 0 ? 'addCar' : 'delCar'
						let param = mol > 0 ? {
							service_id,
							coach_id,
							num: 1
						} : {
							id,
							num: 1
						}
						try {
							let changeNum = await this.$api.order[methodModel](param)
							await this.toCheckBalanceDiscount()
							this.lockTap = false
						} catch (e) {
							this.lockTap = false
						}
					},
					async toShowTime() {
						await this.getStoreDay()
						this.$refs.show_time_item.open()
					},
					async getStoreDay() {
						let data = await this.$api.order.dayText()
						data.map((item, index) => {
							item.title = `${index==0?'今日':index==1?'明日':item.week} ${item.dat_text}`
						})
						this.tabList = data
						let {
							time_str = ''
						} = this.send_info
						let dat_text = this.$util.formatTime(time_str * 1000, 'M-D')
						this.activeIndex = this.tabList.findIndex(item => {
							return item.dat_text == dat_text
						})
						await this.getStoreTime()
						this.loading = false
						this.$util.hideAll()
					},
					async getStoreTime() {
						let {
							id: coach_id,
						} = this.options
						let {
							activeIndex
						} = this
						if (activeIndex < 0) return
						let {
							dat_str: day
						} = this.tabList[activeIndex]
						let {
							id: is_store = 0
						} = this.serviceTypeList[this.serviceTypeInd]
						let {
							time_long
						} = this.orderInfo
						this.timeList = await this.$api.order.timeText({
							is_store,
							coach_id,
							time_long,
							day
						});
						this.loading = false
						this.$util.hideAll()
					},
					handerTabChange(index) {
						this.activeIndex = index
						this.getStoreTime()
					},
					toChooseTime(index) {
						let {
							tabList,
							activeIndex
						} = this
						let item = this.timeList[index]
						if (item.status != 1) return
						item.time =
							`${activeIndex==0?'今日':activeIndex==1?'明日':tabList[activeIndex].week} ${tabList[activeIndex].dat_text} ${item.time_text}`
						this.send_info = item
						this.$refs.show_time_item.close()
					},
					checkInput(e, key) {
						let val = this.$util.formatMoney(e.detail.value)
						this.$nextTick(() => {
							this.form[key] = val
						})
					},
					toConfirmTel(url) {
						// #ifdef APP-PLUS
						if (plus.os.name == 'Android' && plus.navigator.checkPermission(
								'android.permission.CALL_PHONE') ===
							'undetermined') {
							this.call_phone = url
							this.$refs.app_check_item.open()
						} else {
							this.$util.goUrl({
								url,
								openType: 'call'
							})
						}
						// #endif
						// #ifndef APP-PLUS
						this.$util.goUrl({
							url,
							openType: 'call'
						})
						// #endif
					},
					// 查看定位
					async toMap() {
						let {
							address,
							lat,
							lng
						} = this.orderInfo.store_info
						if (!address) return
						// #ifdef MP-WEIXIN
						let privacyCheck = this.$refs.user_privacy.check()
						if (privacyCheck) {
							this.$refs.user_privacy.open()
							return
						}
						// #endif
						// #ifdef APP-PLUS
						this.$util.goMap({
							lat,
							lng,
							address,
							address_info: ''
						})
						return
						// #endif
						await this.$util.checkAuth({
							type: 'userLocation'
						})
						await uni.getLocation({
							type: 'gcj02',
						})
						await uni.openLocation({
							latitude: lat * 1,
							longitude: lng * 1,
							name: address,
							scale: 28
						})
					},
					//表单验证
					validate(param) {
						let validate = new this.$util.Validate();
						this.rule.map(item => {
							let {
								name,
							} = item
							validate.add(param[name], item);
						})
						let message = validate.start();
						return message;
					},
					toConfirmOrder() {
						this.$refs.order_rules_item.close()
						this.isAgree = true
						this.toPay(1)
					},
					toConfirmPay(key) {
						this.$refs.order_tips_item.close()
						if (key == 1) {
							this.$util.goUrl({
								url: 1,
								openType: `navigateBack`
							})
							return
						}
						this.toPay(0)
					},
					async toPay(again_confirm = 1) {
						let param = this.$util.deepCopy(this.form)
						param.text_img = param.text_img && param.text_img.length > 0 ? param.text_img.map(item => {
							return item.path
						}) : []
						let {
							id: is_store = 0
						} = this.serviceTypeList[this.serviceTypeInd]
						if (is_store) {
							let msg = this.validate(param);
							if (msg) {
								this.$util.showToast({
									title: msg
								});
								return
							}
						} else {
							delete param.user_name
							delete param.user_phone
						}
						let {
							coupon_id = 0,
								address_info = {},
								store_id = 0,
								user_cash = 0,
								pay_price = 0,
								is_remember = 0,
								balance_discount_data = {},
								place_order_pop = 0
						} = this.orderInfo
						let {
							id: address_id
						} = address_info
						if (!is_store && !address_id) {
							this.$util.showToast({
								title: `请选择地址`
							})
							return
						}
						let {
							carTypeList,
							carTypeInd,
							payList,
							payInd,
							send_info
						} = this
						if (!send_info.time) {
							this.$util.showToast({
								title: `请选择预约时间`
							})
							return
						}

						let {
							order_rules_status
						} = this.orderRules
						if (order_rules_status == 1 && !this.isAgree) {
							this.$refs.order_rules_item.open()
							return
						}
						if (order_rules_status == 2 && !this.isAgree) {
							this.$util.showToast({
								title: `请先阅读并同意平台《下单须知》`
							})
							return
						}

						let {
							id: car_type
						} = carTypeList[carTypeInd]
						let {
							id: pay_model
						} = payList[payInd]

						if (pay_model == 2 && user_cash * 1 < pay_price * 1) {
							this.$util.showToast({
								title: `账户余额不足`
							})
							return
						}
						let {
							id: coach_id
						} = this.options
						let {
							time_str: start_time
						} = send_info

						let {
							is_balancediscount,
							balance_discount_list = []
						} = balance_discount_data
						let balance_discount_card_arr = ``
						if (pay_model == 4 && is_balancediscount) {
							balance_discount_card_arr = this.$util.getItems(balance_discount_list)
						}
						if (pay_model == 4 && !is_balancediscount) {
							this.$util.showToast({
								title: `请选择储值折扣卡`
							})
							return
						}
						if (place_order_pop && again_confirm) {
							this.$refs.order_tips_item.open()
							return
						}
						param = Object.assign({}, param, {
							coach_id,
							coupon_id,
							address_id,
							is_store,
							store_id,
							car_type,
							pay_model,
							start_time,
							is_remember: is_remember || 0,
							balance_discount_card_arr
						})
						if (this.lockTap) return
						this.lockTap = true
						this.$util.showLoading()
						try {
							let {
								pay_list,
								order_id = 0,
								order_code
							} = await this.$api.order.payOrder(param)
							this.isNoPay = false
							this.$util.hideAll()
							// 微信/支付宝支付
							if (pay_list) {
								if (pay_model == 3) {
									pay_list = {
										orderInfo: pay_list,
										provider: 'alipay'
									}
								}
								// #ifdef H5
								if (pay_model == 3) {
									let {
										autograph
									} = this
									let alipay_params = `?autograph=${autograph}&id=${order_id}`
									pay_list = Object.assign({}, pay_list, {
										order_id,
										page_url: `/pages/order?tab=2`,
										alipay_params
									})
									this.updateOrderItem({
										key: 'alipayOrderParams',
										val: pay_list
									})
									this.$util.goUrl({
										url: `/user/pages/alipay-result${alipay_params}`,
										openType: `redirectTo`
									})
									return
								}
								// #endif


								// #ifdef APP-PLUS
								if (pay_model === 1 && pay_list.adapay) {
									pay_list = Object.assign(pay_list, {
										type: 0,
										order_code
									})
								}
								// #endif


								try {
									let payResType = await this.$util.pay(pay_list)
									if (payResType === 'adapay_app_wechat') {
										this.lockTap = false
										return
									}
									if (payResType != 'adapay_app_alipay') {
										this.$util.showToast({
											title: `支付成功`
										})
									}
									setTimeout(() => {
										this.lockTap = false
										this.$util.goUrl({
											url: '/pages/order?tab=2',
											openType: `reLaunch`
										})
									}, 1000)
								} catch (e) {
									this.$util.showToast({
										title: `支付失败`
									})
									setTimeout(() => {
										this.lockTap = false
										this.$util.goUrl({
											url: '/pages/order?tab=1',
											openType: `reLaunch`
										})
									}, 1000)
								}
								return
							}
							// 余额支付/零元支付
							this.$util.showToast({
								title: `支付成功`
							})
							setTimeout(() => {
								this.lockTap = false
								this.$util.goUrl({
									url: '/pages/order?tab=2',
									openType: `reLaunch`
								})
							}, 1000)
						} catch (e) {
							setTimeout(() => {
								this.lockTap = false
								this.$util.hideAll()
							}, 2000)
						}
					},
					toCopy(url) {
						// #ifdef MP-WEIXIN
						let privacyCheck = this.$refs.user_privacy.check()
						if (privacyCheck) {
							this.$refs.user_privacy.open()
							return
						}
						// #endif
						this.$util.goUrl({
							url,
							openType: 'copy'
						})
					}
				},
				filters: {
					handlePriceTime(val) {
						let text = '无夜间时间段'
						let {
							car_price_start: start,
							car_price_end: end
						} = val
						if (start && end && (start !== end)) {
							if (start !== '00:00' || end !== '24:00') {
								let day = $util.formatTime(new Date(), 'YY-M-D')
								let su = start === '00:00' ? '23:59' : start
								let eu = end === '24:00' ? '00:01' : end
								let st = $util.DateToUnix(`${day} ${su}`)
								let et = $util.DateToUnix(`${day} ${eu}`)
								if (start !== '00:00') {
									st = st - 60
								}
								if (end !== '24:00') {
									et += 60
								}
								let msg = start !== '00:00' && end !== '24:00' ? ' 次日' : ''
								text =
									`${$util.formatTime(et * 1000, 'h:m')} - ${msg}${$util.formatTime(st * 1000, 'h:m')}`
							}
							if (start === '00:00' && end === '23:59') {
								text = '23:59 - 00:00'
							}
						}
						return text
					},
					handleOrderTime(val, time_long) {
						let {
							time,
							time_str
						} = val
						let start_arr = time.split(' ')
						let start_week = start_arr[0]
						let start_day = start_arr[1]
						let start_hours = start_arr[2]
						let text = ` ${start_week}（${start_day}）${start_hours}`
						let end_time = (time_str * 1 + time_long * 60) * 1000
						let today = $util.formatTime(new Date(), 'YY-M-D')
						let end_day = $util.formatTime(end_time, 'M-D')
						let end_week = $util.formatTime(end_time, '周')
						let hours = $util.formatTime(end_time, 'h:m')
						let join = start_day == end_day ? '' : start_week == '今日' ? `明日（${end_day}）` :
							`${end_week}（${end_day}）`
						text += ` 至 ${join}${hours} `
						console.log(text)
						return text
					}
				}
		}
</script>


<style lang="scss">
	.order-pages {

		.item-text {
			width: 200rpx;
			height: 30rpx;
			line-height: 30rpx;
			font-size: 30rpx;
			color: #1F1F1F;
		}

		.item-input {
			min-height: 30rpx;
			line-height: 30rpx;
			padding: 25rpx 0;
			font-size: 26rpx;
			color: #A9A9A9;
		}

		.item-input.text {
			padding: 30rpx 0;
		}

		.list-item {
			.item-img {
				width: 140rpx;
				height: 140rpx;
			}

			.ellipsis {
				max-width: 466rpx;
			}

			.item-tag {
				width: 100rpx;
				height: 36rpx;
				margin-top: -18rpx;
			}

			.iconyduixingxingshixin {
				font-size: 28rpx;
			}

			.item-btn {
				width: 129rpx;
				height: 54rpx;
			}
		}

		.pay-info {
			height: 110rpx;
			bottom: 0;
			height: calc(110rpx + env(safe-area-inset-bottom) / 2);
			padding-bottom: calc(env(safe-area-inset-bottom) / 2);

			.pay-btn {
				width: 182rpx;
				height: 74rpx;
			}
		}

		.popup-rule {
			width: 680rpx;
			height: auto;

			.rule-text {
				min-height: 300rpx;
				max-height: 60vh;
			}

			.iconfont {
				font-size: 60rpx;
			}

			.button {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-top: 50rpx;

				.item-child {
					width: 240rpx;
					height: 90rpx;
					color: #666;
					background: #EEEEEE;
					border-radius: 45rpx;
					margin: 0 20rpx;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}

		.popup-time {
			.time-list {
				width: calc(100% - 20rpx);
				max-height: 70vh;
				padding: 30rpx 10rpx;

				.time-item {
					width: 162rpx;
					height: 110rpx;
					color: #C7C7C7;
					background: #E5E5E5;
					border-radius: 16rpx;
					border: 1px solid #E5E5E5;
					margin: 10rpx;
				}

				.can-choose {
					color: #5A677E;
					background: #FFFFFF;
				}

				.cur-check {
					color: #fff;
				}
			}
		}

		.popup-order-text {
			.icon-close {
				top: 48rpx;
				right: 30rpx;
				font-size: 40rpx;
				color: #A8AEB8;
			}

			.order-text {
				width: 100%;
				color: #5A677E;
				background: #F7F8FA;

				.textarea {
					width: 100%;
					height: 150rpx;
				}
			}

			.item-btn {
				width: 670rpx;
				height: 100rpx;
				margin: 20rpx auto;
			}
		}

	}
</style>